package com.hudson.plugin.server.hibernateDB.service;

import com.hudson.plugin.server.hibernateDB.domain.dao.*;
import com.hudson.plugin.server.hibernateDB.internal.domain.entity.BuildsEntity;
import com.hudson.plugin.server.hibernateDB.internal.domain.entity.HudsonsEntity;
import com.hudson.plugin.server.hibernateDB.internal.domain.entity.ProjectsEntity;
import com.hudson.plugin.server.hibernateDB.internal.domain.entity.ViewsEntity;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.Map;

/**
 * User: yuxinlei
 * Date: 5/30/11
 * Time: 7:23 PM
 */
public interface ReportDBService {
    Map<String, String> storeToDB(Map<String, Map<String, String>> valuePairsContainer) throws Exception;

    @Transactional(readOnly = false, propagation = Propagation.REQUIRED)
    void updatePluginTable(Map<String, String> valuePairs, HudsonsEntity hudsonsEntity, ViewsEntity viewsEntity, ProjectsEntity projectsEntity, BuildsEntity buildsEntity) throws Exception;

    HudsonsDAOInterface getHudsonDAO();

    void setHudsonDAO(HudsonsDAOInterface hudsonDAO);

    ViewsDAOInterface getViewsDAO();

    void setViewsDAO(ViewsDAOInterface viewsDAO);

    ProjectsDAOInterface getProjectsDAO();

    void setProjectsDAO(ProjectsDAOInterface projectsDAO);

    BuildsDAOInterface getBuildsDAO();

    void setBuildsDAO(BuildsDAOInterface buildsDAO);

    BuildRelationsDAOInterface getBuildRelationsDAO();

    void setBuildRelationsDAO(BuildRelationsDAOInterface buildRelationsDAO);
}
